// Verilated -*- C++ -*-
// DESCRIPTION: Verilator output: Tracing implementation internals
#include "verilated_vcd_c.h"
#include "Vtop__Syms.h"


VL_ATTR_COLD void Vtop___024root__trace_init_sub__TOP__0(Vtop___024root* vlSelf, VerilatedVcd* tracep) {
    if (false && vlSelf) {}  // Prevent unused
    Vtop__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp;
    VL_DEBUG_IF(VL_DBG_MSGF("+    Vtop___024root__trace_init_sub__TOP__0\n"); );
    // Init
    const int c = vlSymsp->__Vm_baseCode;
    // Body
    tracep->declBit(c+68,"clk", false,-1);
    tracep->declBit(c+69,"rst_n", false,-1);
    tracep->pushNamePrefix("top ");
    tracep->declBit(c+68,"clk", false,-1);
    tracep->declBit(c+69,"rst_n", false,-1);
    tracep->declBus(c+71,"WIDTH", false,-1, 31,0);
    tracep->declBus(c+71,"N", false,-1, 31,0);
    tracep->declBus(c+56,"pc_next", false,-1, 31,0);
    tracep->declBus(c+33,"snpc", false,-1, 31,0);
    tracep->declBus(c+61,"dnpc", false,-1, 31,0);
    tracep->declBus(c+34,"instr", false,-1, 31,0);
    tracep->declBit(c+62,"zero", false,-1);
    tracep->declBit(c+57,"pcsrc", false,-1);
    tracep->declBit(c+35,"reg_write", false,-1);
    tracep->declBus(c+36,"imm_src", false,-1, 2,0);
    tracep->declBus(c+37,"alu_srcA", false,-1, 1,0);
    tracep->declBus(c+38,"alu_srcB", false,-1, 1,0);
    tracep->declBit(c+39,"mem_write", false,-1);
    tracep->declBus(c+40,"mem_write_mask", false,-1, 3,0);
    tracep->declBit(c+41,"mem_en", false,-1);
    tracep->declBus(c+42,"result_src", false,-1, 1,0);
    tracep->declBus(c+43,"alu_control", false,-1, 2,0);
    tracep->declBus(c+70,"RD1", false,-1, 31,0);
    tracep->declBus(c+63,"RD2", false,-1, 31,0);
    tracep->declBus(c+58,"WD3", false,-1, 31,0);
    tracep->declBus(c+44,"imm_ext", false,-1, 31,0);
    tracep->declBus(c+64,"srcA", false,-1, 31,0);
    tracep->declBus(c+65,"srcB", false,-1, 31,0);
    tracep->declBus(c+61,"alu_result", false,-1, 31,0);
    tracep->declBus(c+66,"read_data", false,-1, 31,0);
    tracep->declBus(c+45,"pc", false,-1, 31,0);
    tracep->pushNamePrefix("u_alu ");
    tracep->declBus(c+71,"N", false,-1, 31,0);
    tracep->declBus(c+43,"alu_control", false,-1, 2,0);
    tracep->declBus(c+64,"srcA", false,-1, 31,0);
    tracep->declBus(c+65,"srcB", false,-1, 31,0);
    tracep->declBus(c+61,"alu_result", false,-1, 31,0);
    tracep->declBit(c+62,"zero", false,-1);
    tracep->declBus(c+59,"add_src1", false,-1, 31,0);
    tracep->declBus(c+64,"add_src2", false,-1, 31,0);
    tracep->declBus(c+67,"sum", false,-1, 31,0);
    tracep->declBit(c+60,"overflow", false,-1);
    tracep->popNamePrefix(1);
    tracep->pushNamePrefix("u_control_unit ");
    tracep->declBit(c+62,"zero", false,-1);
    tracep->declBus(c+46,"op", false,-1, 6,0);
    tracep->declBus(c+47,"funct3", false,-1, 2,0);
    tracep->declBit(c+48,"funct7_5", false,-1);
    tracep->declBit(c+57,"pcsrc", false,-1);
    tracep->declBit(c+35,"reg_write", false,-1);
    tracep->declBus(c+36,"imm_src", false,-1, 2,0);
    tracep->declBus(c+37,"alu_srcA", false,-1, 1,0);
    tracep->declBus(c+38,"alu_srcB", false,-1, 1,0);
    tracep->declBit(c+39,"mem_write", false,-1);
    tracep->declBus(c+40,"mem_write_mask", false,-1, 3,0);
    tracep->declBit(c+41,"mem_en", false,-1);
    tracep->declBus(c+42,"result_src", false,-1, 1,0);
    tracep->declBus(c+43,"alu_control", false,-1, 2,0);
    tracep->declBit(c+49,"branch", false,-1);
    tracep->declBit(c+50,"jump", false,-1);
    tracep->declBus(c+51,"alu_op", false,-1, 1,0);
    tracep->pushNamePrefix("u_alu_decoder ");
    tracep->declBit(c+52,"op5", false,-1);
    tracep->declBus(c+47,"funct3", false,-1, 2,0);
    tracep->declBit(c+48,"funct7_5", false,-1);
    tracep->declBus(c+51,"alu_op", false,-1, 1,0);
    tracep->declBus(c+43,"alu_control", false,-1, 2,0);
    tracep->popNamePrefix(1);
    tracep->pushNamePrefix("u_main_decoder ");
    tracep->declBus(c+46,"op", false,-1, 6,0);
    tracep->declBus(c+47,"funct3", false,-1, 2,0);
    tracep->declBit(c+35,"reg_write", false,-1);
    tracep->declBus(c+36,"imm_src", false,-1, 2,0);
    tracep->declBus(c+37,"alu_srcA", false,-1, 1,0);
    tracep->declBus(c+38,"alu_srcB", false,-1, 1,0);
    tracep->declBit(c+39,"mem_write", false,-1);
    tracep->declBus(c+40,"mem_write_mask", false,-1, 3,0);
    tracep->declBit(c+41,"mem_en", false,-1);
    tracep->declBus(c+42,"result_src", false,-1, 1,0);
    tracep->declBit(c+49,"branch", false,-1);
    tracep->declBus(c+51,"alu_op", false,-1, 1,0);
    tracep->declBit(c+50,"jump", false,-1);
    tracep->popNamePrefix(2);
    tracep->pushNamePrefix("u_data_mem ");
    tracep->declBus(c+71,"WIDTH", false,-1, 31,0);
    tracep->declBus(c+61,"A", false,-1, 31,0);
    tracep->declBit(c+41,"EN", false,-1);
    tracep->declBus(c+40,"WM", false,-1, 3,0);
    tracep->declBit(c+39,"WE", false,-1);
    tracep->declBus(c+63,"WD", false,-1, 31,0);
    tracep->declBus(c+66,"RD", false,-1, 31,0);
    tracep->declBus(c+45,"pc", false,-1, 31,0);
    tracep->declBus(c+34,"instr", false,-1, 31,0);
    tracep->popNamePrefix(1);
    tracep->pushNamePrefix("u_register_file ");
    tracep->declBit(c+68,"clk", false,-1);
    tracep->declBus(c+53,"A1", false,-1, 4,0);
    tracep->declBus(c+54,"A2", false,-1, 4,0);
    tracep->declBus(c+55,"A3", false,-1, 4,0);
    tracep->declBus(c+58,"WD3", false,-1, 31,0);
    tracep->declBit(c+35,"WE3", false,-1);
    tracep->declBus(c+70,"RD1", false,-1, 31,0);
    tracep->declBus(c+63,"RD2", false,-1, 31,0);
    for (int i = 0; i < 32; ++i) {
        tracep->declBus(c+1+i*1,"reg_file", true,(i+0), 31,0);
    }
    tracep->popNamePrefix(2);
}

VL_ATTR_COLD void Vtop___024root__trace_init_top(Vtop___024root* vlSelf, VerilatedVcd* tracep) {
    if (false && vlSelf) {}  // Prevent unused
    Vtop__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp;
    VL_DEBUG_IF(VL_DBG_MSGF("+    Vtop___024root__trace_init_top\n"); );
    // Body
    Vtop___024root__trace_init_sub__TOP__0(vlSelf, tracep);
}

VL_ATTR_COLD void Vtop___024root__trace_full_top_0(void* voidSelf, VerilatedVcd::Buffer* bufp);
void Vtop___024root__trace_chg_top_0(void* voidSelf, VerilatedVcd::Buffer* bufp);
void Vtop___024root__trace_cleanup(void* voidSelf, VerilatedVcd* /*unused*/);

VL_ATTR_COLD void Vtop___024root__trace_register(Vtop___024root* vlSelf, VerilatedVcd* tracep) {
    if (false && vlSelf) {}  // Prevent unused
    Vtop__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp;
    VL_DEBUG_IF(VL_DBG_MSGF("+    Vtop___024root__trace_register\n"); );
    // Body
    tracep->addFullCb(&Vtop___024root__trace_full_top_0, vlSelf);
    tracep->addChgCb(&Vtop___024root__trace_chg_top_0, vlSelf);
    tracep->addCleanupCb(&Vtop___024root__trace_cleanup, vlSelf);
}

VL_ATTR_COLD void Vtop___024root__trace_full_sub_0(Vtop___024root* vlSelf, VerilatedVcd::Buffer* bufp);

VL_ATTR_COLD void Vtop___024root__trace_full_top_0(void* voidSelf, VerilatedVcd::Buffer* bufp) {
    VL_DEBUG_IF(VL_DBG_MSGF("+    Vtop___024root__trace_full_top_0\n"); );
    // Init
    Vtop___024root* const __restrict vlSelf VL_ATTR_UNUSED = static_cast<Vtop___024root*>(voidSelf);
    Vtop__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp;
    // Body
    Vtop___024root__trace_full_sub_0((&vlSymsp->TOP), bufp);
}

VL_ATTR_COLD void Vtop___024root__trace_full_sub_0(Vtop___024root* vlSelf, VerilatedVcd::Buffer* bufp) {
    if (false && vlSelf) {}  // Prevent unused
    Vtop__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp;
    VL_DEBUG_IF(VL_DBG_MSGF("+    Vtop___024root__trace_full_sub_0\n"); );
    // Init
    uint32_t* const oldp VL_ATTR_UNUSED = bufp->oldp(vlSymsp->__Vm_baseCode);
    // Body
    bufp->fullIData(oldp+1,(vlSelf->top__DOT__u_register_file__DOT__reg_file[0]),32);
    bufp->fullIData(oldp+2,(vlSelf->top__DOT__u_register_file__DOT__reg_file[1]),32);
    bufp->fullIData(oldp+3,(vlSelf->top__DOT__u_register_file__DOT__reg_file[2]),32);
    bufp->fullIData(oldp+4,(vlSelf->top__DOT__u_register_file__DOT__reg_file[3]),32);
    bufp->fullIData(oldp+5,(vlSelf->top__DOT__u_register_file__DOT__reg_file[4]),32);
    bufp->fullIData(oldp+6,(vlSelf->top__DOT__u_register_file__DOT__reg_file[5]),32);
    bufp->fullIData(oldp+7,(vlSelf->top__DOT__u_register_file__DOT__reg_file[6]),32);
    bufp->fullIData(oldp+8,(vlSelf->top__DOT__u_register_file__DOT__reg_file[7]),32);
    bufp->fullIData(oldp+9,(vlSelf->top__DOT__u_register_file__DOT__reg_file[8]),32);
    bufp->fullIData(oldp+10,(vlSelf->top__DOT__u_register_file__DOT__reg_file[9]),32);
    bufp->fullIData(oldp+11,(vlSelf->top__DOT__u_register_file__DOT__reg_file[10]),32);
    bufp->fullIData(oldp+12,(vlSelf->top__DOT__u_register_file__DOT__reg_file[11]),32);
    bufp->fullIData(oldp+13,(vlSelf->top__DOT__u_register_file__DOT__reg_file[12]),32);
    bufp->fullIData(oldp+14,(vlSelf->top__DOT__u_register_file__DOT__reg_file[13]),32);
    bufp->fullIData(oldp+15,(vlSelf->top__DOT__u_register_file__DOT__reg_file[14]),32);
    bufp->fullIData(oldp+16,(vlSelf->top__DOT__u_register_file__DOT__reg_file[15]),32);
    bufp->fullIData(oldp+17,(vlSelf->top__DOT__u_register_file__DOT__reg_file[16]),32);
    bufp->fullIData(oldp+18,(vlSelf->top__DOT__u_register_file__DOT__reg_file[17]),32);
    bufp->fullIData(oldp+19,(vlSelf->top__DOT__u_register_file__DOT__reg_file[18]),32);
    bufp->fullIData(oldp+20,(vlSelf->top__DOT__u_register_file__DOT__reg_file[19]),32);
    bufp->fullIData(oldp+21,(vlSelf->top__DOT__u_register_file__DOT__reg_file[20]),32);
    bufp->fullIData(oldp+22,(vlSelf->top__DOT__u_register_file__DOT__reg_file[21]),32);
    bufp->fullIData(oldp+23,(vlSelf->top__DOT__u_register_file__DOT__reg_file[22]),32);
    bufp->fullIData(oldp+24,(vlSelf->top__DOT__u_register_file__DOT__reg_file[23]),32);
    bufp->fullIData(oldp+25,(vlSelf->top__DOT__u_register_file__DOT__reg_file[24]),32);
    bufp->fullIData(oldp+26,(vlSelf->top__DOT__u_register_file__DOT__reg_file[25]),32);
    bufp->fullIData(oldp+27,(vlSelf->top__DOT__u_register_file__DOT__reg_file[26]),32);
    bufp->fullIData(oldp+28,(vlSelf->top__DOT__u_register_file__DOT__reg_file[27]),32);
    bufp->fullIData(oldp+29,(vlSelf->top__DOT__u_register_file__DOT__reg_file[28]),32);
    bufp->fullIData(oldp+30,(vlSelf->top__DOT__u_register_file__DOT__reg_file[29]),32);
    bufp->fullIData(oldp+31,(vlSelf->top__DOT__u_register_file__DOT__reg_file[30]),32);
    bufp->fullIData(oldp+32,(vlSelf->top__DOT__u_register_file__DOT__reg_file[31]),32);
    bufp->fullIData(oldp+33,(((IData)(4U) + vlSelf->top__DOT__pc)),32);
    bufp->fullIData(oldp+34,(vlSelf->top__DOT__instr),32);
    bufp->fullBit(oldp+35,(vlSelf->top__DOT__reg_write));
    bufp->fullCData(oldp+36,(vlSelf->top__DOT__imm_src),3);
    bufp->fullCData(oldp+37,(vlSelf->top__DOT__alu_srcA),2);
    bufp->fullCData(oldp+38,(vlSelf->top__DOT__alu_srcB),2);
    bufp->fullBit(oldp+39,(vlSelf->top__DOT__mem_write));
    bufp->fullCData(oldp+40,(vlSelf->top__DOT__mem_write_mask),4);
    bufp->fullBit(oldp+41,(vlSelf->top__DOT__mem_en));
    bufp->fullCData(oldp+42,(vlSelf->top__DOT__result_src),2);
    bufp->fullCData(oldp+43,(vlSelf->top__DOT__alu_control),3);
    bufp->fullIData(oldp+44,(vlSelf->top__DOT__imm_ext),32);
    bufp->fullIData(oldp+45,(vlSelf->top__DOT__pc),32);
    bufp->fullCData(oldp+46,((0x7fU & vlSelf->top__DOT__instr)),7);
    bufp->fullCData(oldp+47,((7U & (vlSelf->top__DOT__instr 
                                    >> 0xcU))),3);
    bufp->fullBit(oldp+48,((1U & (vlSelf->top__DOT__instr 
                                  >> 0x1eU))));
    bufp->fullBit(oldp+49,(vlSelf->top__DOT__u_control_unit__DOT__branch));
    bufp->fullBit(oldp+50,(vlSelf->top__DOT__u_control_unit__DOT__jump));
    bufp->fullCData(oldp+51,(vlSelf->top__DOT__u_control_unit__DOT__alu_op),2);
    bufp->fullBit(oldp+52,((1U & (vlSelf->top__DOT__instr 
                                  >> 5U))));
    bufp->fullCData(oldp+53,((0x1fU & (vlSelf->top__DOT__instr 
                                       >> 0xfU))),5);
    bufp->fullCData(oldp+54,((0x1fU & (vlSelf->top__DOT__instr 
                                       >> 0x14U))),5);
    bufp->fullCData(oldp+55,((0x1fU & (vlSelf->top__DOT__instr 
                                       >> 7U))),5);
    bufp->fullIData(oldp+56,(((((IData)(vlSelf->top__DOT__u_control_unit__DOT__branch) 
                                & (0U == vlSelf->top__DOT__alu_result)) 
                               | (IData)(vlSelf->top__DOT__u_control_unit__DOT__jump))
                               ? vlSelf->top__DOT__alu_result
                               : ((IData)(4U) + vlSelf->top__DOT__pc))),32);
    bufp->fullBit(oldp+57,((((IData)(vlSelf->top__DOT__u_control_unit__DOT__branch) 
                             & (0U == vlSelf->top__DOT__alu_result)) 
                            | (IData)(vlSelf->top__DOT__u_control_unit__DOT__jump))));
    bufp->fullIData(oldp+58,(((0U == (IData)(vlSelf->top__DOT__result_src))
                               ? vlSelf->top__DOT__alu_result
                               : ((1U == (IData)(vlSelf->top__DOT__result_src))
                                   ? vlSelf->top__DOT__read_data
                                   : ((2U == (IData)(vlSelf->top__DOT__result_src))
                                       ? ((IData)(4U) 
                                          + vlSelf->top__DOT__pc)
                                       : ((3U == (IData)(vlSelf->top__DOT__result_src))
                                           ? vlSelf->top__DOT__imm_ext
                                           : 0U))))),32);
    bufp->fullIData(oldp+59,(((1U & (IData)(vlSelf->top__DOT__alu_control))
                               ? (~ vlSelf->top__DOT__srcB)
                               : vlSelf->top__DOT__srcB)),32);
    bufp->fullBit(oldp+60,((1U & ((~ ((IData)(vlSelf->top__DOT__alu_control) 
                                      >> 1U)) & ((~ 
                                                  ((IData)(vlSelf->top__DOT__alu_control) 
                                                   ^ 
                                                   ((vlSelf->top__DOT__srcA 
                                                     ^ vlSelf->top__DOT__srcB) 
                                                    >> 0x1fU))) 
                                                 & ((vlSelf->top__DOT__u_alu__DOT__sum 
                                                     ^ vlSelf->top__DOT__srcA) 
                                                    >> 0x1fU))))));
    bufp->fullIData(oldp+61,(vlSelf->top__DOT__alu_result),32);
    bufp->fullBit(oldp+62,((0U == vlSelf->top__DOT__alu_result)));
    bufp->fullIData(oldp+63,(vlSelf->top__DOT__RD2),32);
    bufp->fullIData(oldp+64,(vlSelf->top__DOT__srcA),32);
    bufp->fullIData(oldp+65,(vlSelf->top__DOT__srcB),32);
    bufp->fullIData(oldp+66,(vlSelf->top__DOT__read_data),32);
    bufp->fullIData(oldp+67,(vlSelf->top__DOT__u_alu__DOT__sum),32);
    bufp->fullBit(oldp+68,(vlSelf->clk));
    bufp->fullBit(oldp+69,(vlSelf->rst_n));
    bufp->fullIData(oldp+70,(((0U == (0x1fU & (vlSelf->top__DOT__instr 
                                               >> 0xfU)))
                               ? 0U : vlSelf->top__DOT__u_register_file__DOT__reg_file
                              [(0x1fU & (vlSelf->top__DOT__instr 
                                         >> 0xfU))])),32);
    bufp->fullIData(oldp+71,(0x20U),32);
}
